﻿package h.ku.utils{	import flash.events.TimerEvent;	import flash.utils.Timer;		import h.ku.eval.FunctionEval;	import h.ku.eval.Args;
	public class FunctionDictionary	{			public static var dict:Object = 			{				wait:function(a:Args):void				{					var t:Timer = new Timer(a.arguments[0])					t.addEventListener(TimerEvent.TIMER,function(e:TimerEvent):void					{						Timer(e.target).stop()						a.caller.finishFunctionEval("Waited "+a.arguments[0]+" seconds")					})					t.start()				},				out:function(a:Args):void				{					trace(a.arguments[0])					a.caller.finishFunctionEval(null)				},				$:function(a:Args):void				{					a.caller.finishFunctionEval(null)				}			}				public static function getByName(s:String):Function		{			if(dict[s] == null) throw new Error("[Haiku] No function named "+s)			return dict[s]		}	}}